#@adminLayout()

#define main()
  <main class="app-content">
    <div class="app-title">
      <div>
        <h1><i class="fa fa-th-list"></i>角色管理</h1>
        <p>网站角色信息管理</p>
      </div>
      <ul class="app-breadcrumb breadcrumb">
        <li class="breadcrumb-item"><a href="/admin"><i class="fa fa-home fa-lg"></i>仪表盘</a></li>
        <li class="breadcrumb-item active"><a href="/admin/role">角色管理</a></li>
      </ul>
    </div>

    <div class="row">
      <div class="col-md-4">
         <div class="tile">
           <h3 class="tile-title">添加修改角色</h3>
           <div class="tile-body">
             <form method="post" action="">
             	<input type="hidden" name="id" id="id">
               <div class="form-group">
                 <label class="control-label">角色名称</label>
                 <input class="form-control" type="text" placeholder="请输入角色" name="name" id="name" required="required">
               </div>
             </form>
           </div>
           <div class="tile-footer">
             <a class="btn btn-primary" href="javascript:;" onclick="roleSave();"><i class="fa fa-fw fa-lg fa-check-circle"></i>提交</a>
             <p><font id="errorInfo" color="red"></font></p>
           </div>
         </div>
       </div>
      <div class="col-md-8">
        <div class="tile">
          <h3 class="tile-title">角色列表</h3>
          <div class="table-responsive">
            <table class="table table-bordered">
              <thead>
                <tr>
                  <th>编号</th>
                  <th>名称</th>
                  <th>创建时间</th>
                  <th>操作</th>
                </tr>
              </thead>
              <tbody>
              #for(x : rolePage.getList())
                <tr>
                  <td>#(x.id)</td>
                  <td>#(x.name)</td>
                  <td>#date(x.createAt)</td>
                  <td>
                    <a class="btn btn-success btn-sm" href="/admin/role/assignPermissions?id=#(x.id)" title="分配权限"><i class="fa fa-lg fa-plus">权限</i></a>
                    <a class="btn btn-info btn-sm" href="javascript:;" onclick="roleEdit(#(x.id));" title="修改"><i class="fa fa-lg fa-edit">修改</i></a>
                    <a class="btn btn-danger btn-sm " href="javascript:;" onclick="confirmDelete('删除后无法恢复，确定要删除？', '/admin/role/roleDelete?id=#(x.id)');"title="删除"><i class="fa fa-lg fa-trash">删除</i></a>
                  </td>
                </tr>
                #end
              </tbody>
            </table>
            <div>
               #@adminPaginate(rolePage.pageNumber, rolePage.totalPage, "/admin/role?p=")
            </div>
          </div>
        </div>
      </div>
    </div>
  </main>
#end
#define js()
<script type="text/javascript">

</script>
#end